<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <input type="button" value="是" onclick="exclusive(this)" id="1">
    <input type="button" value="是" onclick="exclusive(this)" id="2">
    <input type="button" value="是" onclick="exclusive(this)" id="3">
    <input type="button" value="是" onclick="exclusive(this)" id="4">
    <input type="button" value="是" onclick="exclusive(this)" id="5">

    <script>
        var before = new Object();
        function exclusive(input) {
            var inputObjet = document.getElementById(input.id);
            inputObjet.value = inputObjet.value == "是" ? "否" : "是";
            if (before.id == null || before.id == undefined) {
                before.id = input.id;
                before.value = inputObjet.value

            } else if (before.id != input.id) {
                var inputBeforeObjet = document.getElementById(before.id);
                inputBeforeObjet.value = before.value == "是" ? "否" : "是";
                before.id = input.id;
                before.value = inputObjet.value
            }
        }

    </script>
</body>

</html>